<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="my" uri="/my-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'myBorrowList.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="images/main.css">
	<link rel="stylesheet" type="text/css" href="images/pagingExt.css">
	
	<script type="text/javascript" src="images/jquery.js"></script>
	<script type="text/javascript">
		$(function(){
			$("tr").mouseleave(function(){
				$(this).css("background-color","#fefefe");
				$("thead tr").css("background-color","#F3F8F7");
			});
			$("tr").mouseover(function(){
				$(this).css("background-color","#E9E9E4");
				$("thead tr").css("background-color","#F3F8F7");
			});
		});
	</script>

  </head>
  
  <body>
    <div class="mainBox">
 		<s:set var="datat" value="#{0:'图书',1:'光盘',2:'期刊'}"/>
      <table class="table_list" cellpadding="3" cellspacing="1" border="0">
    	<thead style="background:#F3F8F7"><tr> <td>序号</td><td>条码号/期刊号</td><td>藏馆类型(期刊类型)</td><td>索书号</td><td>题名</td><td>ISBN</td><td>借阅日期</td><td>归还日期</td><td>状态</td></tr></thead>

    	<s:iterator value="#session.SESSION_MY_LIST" var="each" status="st">
    		<tr style="background:#fefefe">
    		<td><s:property value="#st.index + 1"/></td>
    		<td><s:property value="#each.borrowBook.bookBarCode"/><s:property value="#each.borrowBook.periNo"/></td>
			<td><s:property value="#datat[#each.borrowBook.dataType]"/>
    		<s:if test="#each.borrowBook.periType!=null">
    		(<s:property value="#each.borrowBook.periType"/>)
    		</s:if>
    		</td>
    		<td><s:property value="#each.borrowBook.bookCallNo"/></td>
    		<td><a href="queryBook?op=info&id=<s:property value="#each.borrowBook.bookId"/>" title="查看本书详情">
    		<s:if test="#each.borrowBook.bookName.length()>=15">
    		<s:property value="#each.borrowBook.bookName.substring(0,14)"/>...
    		</s:if>
    		<s:else>
    		<s:property value="#each.borrowBook.bookName"/>
    		</s:else>
    		</a></td>
    		<td><a href="http://book.douban.com/isbn/<s:property value="#each.borrowBook.ISBN"/>" target="_blank" title="去豆瓣查看本书介绍"><s:property value="#each.borrowBook.ISBN"/></a></td>
    		<td><s:property value="#each.borrowTime"/></td>
    		<td><s:property value="#each.returnTime"/></td>
    		<td>
				<s:set value="#{0:'未归还',1:'已归还' }" var="borState"/>
				<s:property value="#borState[#each.isReturn]"/>
			</td>
    		</tr>
    	</s:iterator>
    	
    		<tr style="background:#fefefe"><td colspan="99" align="right">
<my:page pageSize="${sessionScope.SESSION_MY_PAGESIZE }"
						pageNo="${sessionScope.SESSION_MY_PAGENO }" url="bookOnLoan"
						count="${sessionScope.SESSION_MY_COUNT }"></my:page>
				</td></tr>
    	</table>
    
    </div>
  </body>
</html>
